/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dto;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import java.io.Serializable;
import org.jdesktop.swingx.mapviewer.GeoPosition;

/**
 *
 * @author steffen
 */
@DatabaseTable(tableName = "GeoPoint")
public class GeoPoint implements Serializable {
    
    private static final String LAN_DEG_TABLE_NAME = "lan_deg";
    private static final String LON_DEG_TABLE_NAME = "lon_deg";
//    private static final String LAN_DMS_TABLE_NAME = "lan_dms";
//    private static final String LON_DMS_TABLE_NAME = "lon_dms";
            
    @DatabaseField(columnName = LAN_DEG_TABLE_NAME)
    private float lanDeg;
    @DatabaseField(columnName = LON_DEG_TABLE_NAME)
    private float lonDeg;
    @DatabaseField(generatedId = true)
    private long id;
//    @DatabaseField(columnName = LAN_DMS_TABLE_NAME)
//    private float[] lanDMS;
//    @DatabaseField(columnName = LON_DMS_TABLE_NAME)
//    private float[] lonDMS;

    public GeoPoint() {}
    
    public GeoPoint(float lanDeg, float lonDeg) {
        this.lanDeg = lanDeg;
        this.lonDeg = lonDeg;
    }
    
    public float getLanDeg() {
        return lanDeg;
    }

    public void setLanDeg(float lanDeg) {
        this.lanDeg = lanDeg;
    }

    public float getLonDeg() {
        return lonDeg;
    }

    public void setLonDeg(float lonDeg) {
        this.lonDeg = lonDeg;
    }

//    public float[] getLanDMS() {
//        return lanDMS;
//    }
//
//    public void setLanDMS(float[] lanDMS) {
//        if(lanDMS.length != 3)
//            throw new IllegalArgumentException();
//        this.lanDMS = lanDMS;
//    }
//
//    public float[] getLonDMS() {
//        return lonDMS;
//    }
//
//    public void setLonDMS(float[] lonDMS) {
//        if(lanDMS.length != 3)
//            throw new IllegalArgumentException();
//        this.lonDMS = lonDMS;
//    }
    
    public GeoPosition toGeoPosition() {
        return new GeoPosition(lanDeg, lonDeg);
    }

    @Override
    public String toString() {
        return "Lan: " + lanDeg + " Lon: " + lonDeg;
    }
}
